package com.heima.Job2;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        Movie m1 = new Movie("《肖生克的救赎》", 9.7, "罗宾斯");
        Movie m2 =   new Movie("《霸王别姬》" , 9.6 ,  "张国荣、张丰毅");
        Movie m3 =  new Movie("《阿甘正传》" , 9.5 ,  "汤姆.汉克斯");
        Collection<Movie> movies = new ArrayList<>();
        movies.add(m1);
        movies.add(m2);
        movies.add(m3);
        Iterator<Movie> it = movies.iterator();
        while (it.hasNext()) {
            Movie next =  it.next();
            System.out.println(next);

        }
    }
}
